package designPatterns.迭代器模式;

public class Test {

    public static void main(String[] args) {
        BookShelf bookShelf = new BookShelf();
        bookShelf.appendBook(new Book("lw"));
        bookShelf.appendBook(new Book("xx"));
        bookShelf.appendBook(new Book("zy"));
        bookShelf.appendBook(new Book("heh"));
        Iterator iterator = bookShelf.iterator();
        while (iterator.hasNext()){
            System.out.println(((Book)iterator.next()).getName());
        }
    }

}
